<extend name="./Apps/Home/View/default/users/layout.html" />
<block name="content">
<link rel="stylesheet" href="__ROOT__/Apps/Home/View/default/css/userorder.css" />

    <div class="wst-body"> 
       
	   <div class="wst-order-userinfo-box" style="">
	   		<div class="wst-userimg-box">
	   			<img src="<empty name="WST_USER['userPhoto']">__ROOT__/Apps/Home/View/default/images/logo.png<else/>__ROOT__/{$WST_USER['userPhoto']}</empty>" height="100" width="100" />
	   		</div>
	   		<div class="wst-userlogin-box">
	   			<div><span style="font-size:16px;">欢迎您：</span><span style="font-weight:bolder;color:#fff100;">{$WST_USER["loginName"]}</span><if condition='$WST_USER["userRank"]["rankName"] neq ""'>({$WST_USER["userRank"]['rankName']})</if></div>
	   			<div>上次登录时间：{$WST_USER["lastTime"]}</div>
	   			<div>上次登录IP：{$WST_USER["lastIP"]}</div>
	   			<div class="wst-user-adr">
	   				<div>我的积分：<a  href="{:U('Home/Users/toScoreList/')}"><span style="font-weight:bolder;color:#fff100;">{$userScore}</span></a> 个</div>
	   				<a style="color:#ffffff;" href="{:U('Home/UserAddress/queryByPage/')}">我的收货地址</a>&nbsp;&nbsp;&nbsp;
	   				<a href="{:U('Home/Users/toEdit/')}" style="color:#ffffff;">编辑个人资料</a>
	   			</div>
	   		</div>
	   		<div class="wst-clear"></div>
	   </div>
	   
       <div class="wst-order-tg">
       		<div class="wst-oinfo-box">
       			<div style="">
       			<div style="float:left;width:110px;">待付款<a href="{:U('Home/Orders/queryPayByPage/')}"><span>{$statusList[-2]}</span></a></div>
       			<div style="float:left;width:108px;border-left:1px solid #cccccc;border-right:1px solid #cccccc;">待发货<a href="{:U('Home/Orders/queryDeliveryByPage/')}"><span>{$statusList[2]}</span></a></div>
       			<div style="float:left;width:108px;border-left:1px solid #cccccc;border-right:1px solid #cccccc;">待收货<a href="{:U('Home/Orders/queryReceiveByPage/')}"><span>{$statusList[3]}</span></a></div>
       			<div style="float:left;width:108px;border-left:1px solid #cccccc;border-right:1px solid #cccccc;">待评价<a href="{:U('Home/Orders/queryAppraiseByPage/')}"><span>{$statusList[4]}</span></a></div>
       			<div style="float:left;width:110px;">退款<a href="{:U('Home/Orders/queryRefundByPage/')}"><span>{$statusList[-3]}</span></a></div>
       			<div class="wst-clear"></div>
       			</div>
       		</div>
       </div>
       <div class="wst-mywl">
       		<img src="__ROOT__/Apps/Home/View/default/images/icon_top_03.png"  /><span style="color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;我的物流</span>
       </div>
       <div style="margin-top:10px;text-align:center;padding:5px;">
       		<table class="wst-order-tab" cellspacing ="0" cellpadding="0">
       			<tbody>
       				<volist name="orderList['root']" id="order" key='key1'>
       				<tr >
       					<td width="150">
       						<volist name="order['goodslist']" id="goods" key='key2'>
								<a href="{:U('Home/Goods/getGoodsDetails',array('goodsId'=>$goods['goodsId']))}">
									<img src="__ROOT__/{$goods['goodsThums']}" height="50" width="50"/>
								</a>
							</volist>
       					</td>
       					<td style="text-align:left;">
       						{$order["userName"]} | {$order["userAddress"]}{$order["userTel"]} | {$order["userPhone"]}<br/>
       						{$order["createTime"]}&nbsp;&nbsp;&nbsp;&nbsp;<!--a href="">查看物流明细</a-->
       					</td>
       					<td width="80">
	       					<if condition='$order["payType"] eq 0'>
	       						货到付款
	       					<else/>
	       						在线支付
			               	</if>
       					</td>
       					<td width="60">
	       					<if condition='($order["orderStatus"] eq -3) OR ($order["orderStatus"] eq -4)'>拒收
	       					<elseif condition='$order["orderStatus"] eq -5'/>店铺不同意拒收
			               	<elseif condition='$order["orderStatus"] eq -2'/>未付款
			               	<elseif condition='($order["orderStatus"] eq -6) OR ($order["orderStatus"] eq -7) OR ($order["orderStatus"] eq -1)'/>已取消
			               	<elseif condition='$order["orderStatus"] eq 0'/>未受理
			               	<elseif condition='$order["orderStatus"] eq 1'/>已受理
			               	<elseif condition='$order["orderStatus"] eq 2'/>打包中
			               	<elseif condition='$order["orderStatus"] eq 3'/>配送中
			               	<elseif condition='$order["orderStatus"] eq 4'/>已到货
			               	</if>
       					</td>
       					<td width="120">
       						<if condition='$order["orderStatus"] gt 3'>
								<if condition="$order['isAppraises'] eq 1">
								已评价
								<else/>
								<a  href="javascript:;" onclick="appraiseOrder({$order['orderId']})">评价</a>
								</if>
							</if>
       						<if condition='$order["payType"] eq 1'>
       							<if condition='$order["orderStatus"] eq -2'>
       								<a href="javascript:;" onclick="toPay({$order['orderId']})">[ 支付 ]</a><br/>
       							</if>
       						</if>
							<a href="javascript:;" onclick="showOrder({$order['orderId']})">[ 查看 ]</a>
							<if condition='($order["orderStatus"] eq 0) or ($order["orderStatus"] eq -2) or ($order["orderStatus"] eq 1) or ($order["orderStatus"] eq 2)'> 
							<a href="javascript:;" onclick="orderCancel({$order['orderId']},{$order['orderStatus']})">[ 取消订单 ]</a>
       						</if>
       						
       					</td>
       				</tr>
       				</volist>
       				<if condition="$orderList['totalPage'] gt 1">
       				<tr >
						<td colspan="5" style="height:30px;border-bottom: 0px;">
							<div class="wst-page" style="float:right;padding-bottom:10px;">
								<div id="wst-page-items">	
								</div>
							</div>
						</td>
       				</tr>
       				</if>
       			</tbody>
       		</table>
       </div>
    </div>
	<script>
	
    <if condition="$orderList['totalPage'] gt 1">
    $(document).ready(function(){
    	laypage({
    	    cont: 'wst-page-items',
    	    pages: {$orderList['totalPage']}, //总页数
    	    skip: true, //是否开启跳页
    	    skin: '#e23e3d',
    	    groups: 3, //连续显示分页数
    	    curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
    	        var page = location.search.match(/pcurr=(\d+)/);
    	        return page ? page[1] : 1;
    	    }(), 
    	    jump: function(e, first){ //触发分页后的回调
    	        if(!first){ //一定要加此判断，否则初始时会无限刷新
    	        	var nuewurl = WST.splitURL("pcurr");
    	        	var ulist = nuewurl.split("?");
    	        	if(ulist.length>1){
    	        		location.href = nuewurl+'&pcurr='+e.curr;
    	        	}else{
    	        		location.href = '?pcurr='+e.curr;
    	        	}
    	            
    	        }
    	    }
    	});
    })
	</if>
	</script>
</block> 